package com.ebc.eservice.controller.pc;

import com.ebc.eservice.service.EbcClientService;
import com.ebc.eservice.util.JsonResult;
import com.ebc.eservice.util.common.constant.ApiTextHelperConstant;
import com.ebc.eservice.util.common.constant.DeveloperConstant;
import com.ebc.eservice.vo.client.ClientQueryReqVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Joey
 * @Description: 名片 & 客户管理
 * @date:2022/10/5 11:15
 */
@Api(tags = "后台管理系统-人员-客户管理")
@RestController
@RequestMapping("/clientManage")
public class CardClientController {

    @Autowired
    private EbcClientService ebcClientService;

    //获取客户列表
    @ApiOperation(value = "获取客户列表", notes = ApiTextHelperConstant.DEVELOPER + DeveloperConstant.FH
            +" 根据公司id 获取所有名片下的客户")
    @PostMapping("/getClientList")
    public JsonResult getStaffList(Integer companyId){
        return ebcClientService.getClientList(companyId);
    }

    //查询 & 客户编号/名称/员工编号/名称
    @ApiOperation(value = "查询 & 客户编号/名称/员工编号", notes = ApiTextHelperConstant.DEVELOPER + DeveloperConstant.FH)
    @PostMapping("/queryClientByInfo")
    public JsonResult queryClientByInfo(@RequestBody ClientQueryReqVo clientQueryReqVo){
        return ebcClientService.queryClient(clientQueryReqVo);
    }

}
